﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using KPIS.GERP.GFMS.DALFactory;
using KPIS.GERP.GFMS.IBLL;
using KPIS.GERP.GFMS.IDAL;
using KPIS.GERP.GFMS.MODEL;

namespace KPIS.GERP.GFMS.BLL
{
    public class B_FIM_Payroll : IBLL_FIM_Payroll
    {
        private static readonly IDAL_FIM_Payroll dal = DataAccess.Create_FIM_Payroll();

        #region Implementation of IBLL_FIM_Payroll

        public IList<M_FIM_Payroll> GetPayrolls(int? payroll_seq = null, string payroll_ref_no = null)
        {
            return dal.GetPayrolls(payroll_seq, payroll_ref_no);
        }

        public IList<M_FIM_Payroll> GetPayrolls(int month, int year)
        {
            return dal.GetPayrolls(month, year);
        }

        public IList<M_ICM_MasContact> GetIcmMasContact()
        {
            return dal.GetIcmMasContact();
        }

        public bool CheckSentToPayment(int month, int year)
        {
            return dal.CheckSentToPayment(month, year);
        }

        public int GetCurrentBgmYear()
        {
            return dal.GetCurrentBgmYear();
        }

        public int InsertPayroll(M_FIM_Payroll model)
        {
            return dal.InsertPayroll(model);
        }

        public void UpdatePayroll(M_FIM_Payroll model)
        {
            dal.UpdatePayroll(model);
        }

        public void DeletePayroll(int payroll_seq, int emp_seq)
        {
            dal.DeletePayroll(payroll_seq, emp_seq);
        }

        public void MarkAsSentToPayment(int month, int year, int emp_seq)
        {
            dal.MarkAsSentToPayment(month, year, emp_seq);
        }

        public void MarkAsNotSentToPayment(int month, int year, int emp_seq)
        {
            dal.MarkAsNotSentToPayment(month, year, emp_seq);
        }

        public IList<M_FIM_PayrollDeduction> GetPayrollDeductions(int? payroll_seq = null, 
            int? payroll_deduction_seq = null, string payroll_ref_no = null)
        {
            return dal.GetPayrollDeductions(payroll_seq, payroll_deduction_seq, payroll_ref_no);
        }

        public void InsertPayrollDeduction(M_FIM_PayrollDeduction model)
        {
            dal.InsertPayrollDeduction(model);
        }

        public void UpdatePayrollDeduction(M_FIM_PayrollDeduction model)
        {
            dal.UpdatePayrollDeduction(model);
        }

        public void DeletePayrollDeduction(int payroll_deduction_seq, int emp_seq)
        {
            dal.DeletePayrollDeduction(payroll_deduction_seq, emp_seq);
        }

        public DataTable PayrollTotal(int intMonth, int intYear)
        {
            return dal.PayrollTotal(intMonth, intYear);
        }

        public DataTable PayrollCombine(int flag)
        {
            return dal.PayrollCombine(flag);
        }

        public DataTable GridPayrollCombine(int intMonth, int intYear)
        {
            return dal.GridPayrollCombine(intMonth, intYear);
        }

        public string PaymentGroupName(int flag)
        {
            return dal.PaymentGroupName(flag);
        }

        public decimal  SumAmount(int flag)
        {
            return dal.SumAmount(flag);
        }

        public string SumDeduction(int intMonth, int intYear)
        {
            return dal.SumDeduction(intMonth, intYear);
        }

        public void InsertSentpayment(M_FIM_Payroll_Sentpayment info)
        {
             dal.InsertSentpayment(info);
        }

        public void InsertSentpaymentCombine(int ConId, string Name, decimal amount, int created_by, int intMonth
            , int intYear, int payrollSeq, int ChequeSeq)
        {
            dal.InsertSentpaymentCombine(ConId, Name, amount, created_by, intMonth, intYear, payrollSeq, ChequeSeq);
        }
        public void sentpaymentCombineSeq(int? intPayrollDeductionSeq, int intpayrollSeq)
        {
            dal.sentpaymentCombineSeq(intPayrollDeductionSeq, intpayrollSeq);
        }

        public void UpdatePayseqToCombine(int SentpaymentCombineSeq)
        {
            dal.UpdatePayseqToCombine(SentpaymentCombineSeq);
        }
        public string RunningNumber()
        {
            return dal.RunningNumber();
        }

        public void DeleteSentpayment(int intPaySeq, int SentpaymentCombineSeq)
        {
            dal.DeleteSentpayment(intPaySeq, SentpaymentCombineSeq);
        }

        public void DeletePayment(int intPaySeq)
        {
            dal.DeletePayment(intPaySeq);
        }

        public void DeleteMoneyReq(int intPaySeq)
        {
            dal.DeleteMoneyReq(intPaySeq);
        }

        public void DeleteMoneyDtlReq(int intPaySeq)
        {
            dal.DeleteMoneyDtlReq(intPaySeq);
        }

        public void DeleteSentpaymentComb(int intMonth, int intYear)
        {
            dal.DeleteSentpaymentComb(intMonth, intYear);
        }

        public void UpdateFlagSentpayment(int? intPayrollDeductionSeq, int flagSentpayment)
        {
            dal.UpdateFlagSentpayment(intPayrollDeductionSeq, flagSentpayment);
        }

        public string RunningFlagGroup()
        {
           return dal.RunningFlagGroup();
        }

        public string BgmyearToPayment(int SentpaymentCombineSeq)
        {
           return dal.BgmyearToPayment(SentpaymentCombineSeq);
        }

        public void InsertCheques(int paySeq, int? chequeSeq, decimal amount, int created_by)
        {
             dal.InsertCheques(paySeq, chequeSeq, amount, created_by);
        }
        #endregion
    }
}